fix(referral-traffic): order Traffic Insights sources cdn-first#2655
fix(referral-traffic): order Traffic Insights sources cdn-first#2655cwjwisse wants to merge 1 commit into
Conversation
The has-data endpoint now returns availableSources ordered cdn-first instead of optel-first. Clients (referral dashboard, agentic, url-inspector) pick availableSources[0] as the active source, so this makes them all seed cdn over optel for free, matching the product rule "always prefer cdn". Flips the TRAFFIC_INSIGHTS_SOURCES constant (TRAFFIC_INSIGHTS_TABLES derives from it and follows in lockstep) and the has-data both-records test assertion. The filter-dimensions availableSources path is unaffected: it comes from the RPC row.available_sources, a separate code path. AA/GA4/CJA are unaffected — they live in the separate Business Impact tab and have their own DRS provider check; has-data availableSources is type-locked to 'optel'|'cdn' only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Hey @cwjwisse,
⚠ Degraded review - no spec document was found for this change (searched the PR links, the touched repos' docs, the architecture/guidelines docs, and linked Jira). This review covers code-level quality but could not validate the change against an agreed design, so confidence is reduced. Add a spec link (PR template section 4) and re-request review for a full-confidence pass.
Verdict: Approve - clean, well-scoped config flip with matching test coverage.
Changes: reorders the Traffic Insights source priority array from optel-first to cdn-first so clients prefer cdn as the active data source (2 files).
No issues found. The constant reorder, derived table mapping, comment updates, and test assertion all move in lockstep. No logic paths are affected beyond output ordering since TRAFFIC_INSIGHTS_TABLES is derived via .map from the same array.
Skill: pr-review | Model: us.anthropic.claude-opus-4-6-v1[1m] | Duration: 0m 42s | Cost: $2.06 | Commit: ed451733b1b0a2d7ab518bb66de2eba4115dff2e
If this code review was useful, please react with 👍. Otherwise, react with 👎.
What
Flips the Traffic Insights source-ordering so the
has-dataendpoint returnsavailableSourcescdn-first instead of optel-first.src/controllers/llmo/llmo-referral-traffic.js:TRAFFIC_INSIGHTS_SOURCES = ['optel', 'cdn']→['cdn', 'optel'](the derivedTRAFFIC_INSIGHTS_TABLESfollows in lockstep).Why
Referral Traffic Insights has two mutually-exclusive sources per site (optel & cdn). Product rule: always prefer cdn over optel. Clients (referral dashboard, agentic, url-inspector) read
availableSources[0]as the active source, so orderinghas-datacdn-first makes all of them seed cdn over optel for free.AA / GA4 / CJA are unaffected — they live in the separate Business Impact tab and use their own DRS provider check. The
has-dataavailableSourcesis type-locked to'optel' | 'cdn'only.Scope / not changed
availableSourcespath is untouched — it comes from the RPCrow.available_sources, a different code path independent of this constant.Merge order
availableSources[0]; until this lands it degrades gracefully to optel.Test
npx mocha test/controllers/llmo/llmo-referral-traffic.test.js→ 89 passing (flipped the has-data both-records assertion to['cdn', 'optel']).eslinton changed files clean.🤖 Generated with Claude Code